package com.longway.common.ext.directive;

import java.io.IOException;
import java.util.Calendar;
import java.util.Date;

import com.jfinal.template.Directive;
import com.jfinal.template.Env;
import com.jfinal.template.io.Writer;
import com.jfinal.template.stat.Scope;

public class FootDirective extends Directive {
	
	
	@Override
    public void exec(Env env, Scope scope, Writer writer) {
		String company = "&copy;  山西中蓝无忧科技服务有限公司  晋ICP备2023015604号";
		Calendar cal = Calendar.getInstance();
		String version = "1.0.0";
		StringBuilder sb = new StringBuilder();
		sb.append("<footer class=\"main-footer text-center\">");
		sb.append("   <div class=\"pull-right hidden-xs\">");
		sb.append("		 <b>Version</b> "+version);
		sb.append("	  </div>");
		sb.append("	  <span id=\"support\">版权: <a style=\"color:black\" href=\"https://beian.miit.gov.cn\">"+company+"</a> © "+cal.get(Calendar.YEAR) +"</span>");
		sb.append("</footer>");
		try {
			writer.write(sb);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
